man command
for more information about that command. i.e. man man
will give
you information about the man command itself.
passwd
command to set a password.
> passwd
Changing local password for root
New password:
Retype new password:
You will be asked to type in the password twice to make sure you have not
mistyped it. The password you type in will not be displayed on the screen.
You should remember your root password as without it you will be unable to
administer your NetBSD system.disklabel
command to find which partition
/local is on. If you hard disk is sd0 then you would use the following
command.
> disklabel sd0 size offset fstype [fsize bsize cpg]
a 62400 1035320 4.2BSD 1024 8192 0 # (Cyl. 1991-2110)
b 290680 1097720 swap # (Cyl. 2111-2669)
c 2069600 0 unused 0 0 # (Cyl. 0-3979)
d 1034280 1040 ADOS # (Cyl. 2-1990)
e 274040 1388400 4.2BSD 1024 8192 0 # (Cyl. 2670-3196)
f 407160 1662440 4.2BSD 1024 8192 0 # (Cyl. 3197-3979)
Compare the output of disklabel
against the output of the
df -k
command to see which partitions
are already mounted or check the
list of start and end cylinders if you created one during the NetBSD install
process.
> df -k
Filesystem 1k-Blocks Used Avail Capacity Mounted On
/dev/sd0a 30031 10578 17951 37% /
/dev/sd0e 132251 79028 46610 63% /usr
Use the newfs
command to create a unix filesystem on the
correct partition. The output produced will depened on the size of your
/local partition.
> newfs /dev/sd0f
newfs: /dev/sd0f: not a character-special device
/dev/sd0f: 407160 sectors in 783 cylinders of 5 tracks, 104 sectors
198.8MB in 49 cyl groups (16 c/g, 4.06MB/g, 1024 i/g)
super-block backups (for fsck -b #) at:
32, 8464, 16896, 25328, 33760, 42192, 50624, 59056,
66592, 75024, 83456, 91888, 100320, 108752, 117184, 125616,
133152, 141584, 150016, 158448, 166880, 175312, 183744, 192176,
199712, 208144, 216576, 225008, 233440, 241872, 250304, 258736,
266272, 274704, 283136, 291568, 300000, 308432, 316864, 325296,
332832, 341264, 349696, 358128, 366560, 374992, 383424, 391856,
399392,
> mkdir /local
mount
command.> mount /dev/sd0f /local
df -k
will now show that you have three filesystems
mounted.
> df -k
Filesystem 1k-Blocks Used Avail Capacity Mounted On
/dev/sd0a 30031 10578 17951 37% /
/dev/sd0e 132251 79028 46610 63% /usr
/dev/sd0f 196507 00012 196495 01% /local
If you wish to mount the /local filesystem every time you boot NetBSD you
must edit the file /etc/fstab
. First make a copy of it in
case you make a mistake whilst editing.
> cp /etc/fstab /etc/fstab.old
vi
to edit /etc/fstab
. You must add an
extra entry, similar to that for /usr for the /local filesystem.> vi /etc/fstab
/dev/sd0a / ffs rw 1 1
/dev/sd0e /usr ffs rw 1 2
/dev/sd0f /local ffs rw 1 2
<esq> w q >enter<
to save the changes and exit vi. If you make a mistake during editing use
the key combination
<esq> q ! >enter<
to exit without saving the changes.vipw
command.
For more information about the format of the /etc/fstab
file
use the command man fstab
vipw
command to edit the
/etc/passwd
file./etc/passwd
file looks similar to the one shown below.
root:#######:0:0::Superuser:/root:/bin/csh
toor:*:0:0::Borne-again Superuser:/root:
daemon:*:1:31::The Devil Himself:/root:
operator:*:2:20::System &:/usr/gues/operator:/bin/csh
bin:*:3:7::Binaries Commands and Source,,,:/:/dev/null
games:*:7:13::Games pseudo User:/usr/games:
uucp:*:66:1::Unix-to-Unix copy:/var/spool/uucppublic:/usr/libexec/uucico
nobody:*:32767:9999::Unprivileged User:/nonexistent:/dev/null
ingres:*:267:74::& Group:/usr/inges:/bin/csh
falken:*:32766:31::Prof Stephen &:/usr/games:/usr/bin/wargames
Each line in the file corresponds to one user and contains the following
information sperated by colons (:)/etc/passwd
file. You should not attempt to change or add
anything to the entry in
this field. Instead use the passwd
command to set or change a
users password.
user1:*:13:20::My First User:/export/home/user1:/bin/csh
esc : q ! <enter>
When you have made all the required changes save and exit using the key
combination
esc : w q <enter>
Warning: you are strongly advised to read the section using vi before using the vipw
command.
> cd /export/home
If /export/home does not yet exists on your machine you must create it with
the following command
> mkdir -p /export/home
> chmod 755 /export/home
> cd /export/home
> mkdir user1
> chown user1 user1
> chgrp staff user1
su
to
root they must be a member of the group "wheel". This can be achieved by
making "wheel" their primary group in the /etc/passwd
file or by
adding them to the list of members of the group wheel in the
/etc/group
file. See Adding
A New Group for details of how to do this.
/etc/group
. To find out the numeric group ID's available on your machine
use the more
command to view the contents of
/etc/group.
> more /etc/group
wheel:*:0:root
daemon:*:1:daemon
kmem:*:2:root
sys:*:3:root
tty:*:4:root
operator:*:5:
bin:*:7:
news:*:8:
usrc:*:9:
games:*:13:
staff:*:20:root
guest:*:31:root
nobody:*:39:
utmp:*:45:
ingres:*:47:ingres
dialer:*:117:
nogroup:*:32766:
Each line corresponds to a group and consists of the following fields seperated by colons (:).
/etc/group
then their group is determined by the entry in the /etc/passwd
file./etc/group
file using vi
.
sysadmin:*:21:
/etc/group
before you edit it!
> cp /etc/group /etc/group.old
> vi /etc/group
If you wanted to create the sysadmin group with 3 users, Ben, Chris, and Nick you would add the following line instead.
sysadmin:*:21:ben,chris,nick
Note: If you wish a user to be able to su
to
root they must be a member of the group "wheel".
> cp /bin/reboot /bin/reboot.amiga
Now create the new reboot command.
echo "cp /netbsd /dev/reload" > /bin/reboot
You can now use the command reboot
to reboot NetBSD and
reboot.amiga
to reboot into AmigaDOS.ls -la
to see all files including those beginning with a dot.alias mail Mail set history=1000 set path=(/sbin /usr/sbin /bin /usr/bin /usr/local/X11R6.1/bin /usr/local/bin) # directory stuff: cdpath/cd/back set cdpath=(/sys /usr/src/{bin,sbin,usr.{bin,sbin},pgrm,lib,libexec,share,contrib,local,devel,games,old,}) setenv BLOCKSIZE 1k alias cd 'set old=$cwd; chdir \!*' alias h history alias j jobs -l alias ll ls -l alias back 'set back=$old; set old=$cwd; cd $back; unset back; dirs' alias z suspend alias x exit alias pd pushd alias pd2 pushd +2 alias pd3 pushd +3 alias pd4 pushd +4 alias tset 'set noglob histchars=""; eval `\tset -s \!*`; unset noglob histchars' if ($?prompt) then set prompt="`hostname -s`# " endif